<include file="Public:top" />        
     <script>
        $(function() {
		  
		  $(".status .light").click(function(){		
			   var id = $(this).parent().parent().attr("id");
			   $.get("{:U('changeStatus')}", { id: id },
				function(data){
					 $("#"+id).find("span").removeClass("current");
				 	 if (data == 1)
					 {
						 $("#"+id).find("span").eq(0).addClass("current");
					 }
					 else
					 {
						 $("#"+id).find("span").eq(1).addClass("current");
					 }
				}); 
		  })  		
	})
      
		
	</script>
	</head>
  
	<body >
    
    <div id="body-wrapper" > <!-- Wrapper for the radial gradient background -->		

        <!--left start-->
		
        <include file="Public:left" /> 
        <!--left end-->
        
        
        <!-- End #sidebar -->			
		<div id="main-content"> <!-- Main Content Section with everything -->
        <div  id="header_logo">{:C("SITE_INFO.name")}</div>	 		
			
			<!-- Page Head -->
			<div style="float:left; width:380px;">
			  <h2>商品列表  </h2></div>
			  <div id="sreach" style="width:1030px;">
            <form name="sreach" method="get" action="{:U('index')}">
            	  {:W('Shengshi',array('now_city_id'=>$citycode,'now_prov_id'=>$provcode,'now_area_id'=>$area_id))}
              <strong>分类:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="category">
                <foreach name="cate" item="vo">
                	<option value="<if condition="$vo['id'] eq 0"><else/>{$vo.id}</if>"   <if condition="$vo['id'] eq $category ">selected="selected"</if>>{$vo.text}</option>
                </foreach>
              </select>
              <br/><br/>
               &nbsp;<strong>发布状态:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="status">
                <option value="-1" <if condition="$status eq -1">selected="selected"</if> >All Status</option>
                 <option value="1" <if condition="$status eq 1 ">selected="selected"</if> >Enabled</option>  
                <option value="0"<if condition="$status eq 0 ">selected="selected"</if> >Disabled</option>
                            
              </select>
              &nbsp;<strong>商品类型:</strong>
              <select onChange="document.getElementById('keyword').value='';document.sreach.submit(); return false;" name="products_type">
                <option value="-1" <if condition="$products_type eq -1">selected="selected"</if> >All Class</option>
                <option value="1" <if condition="$products_type eq 1 ">selected="selected"</if> >一口价</option>  
                <option value="2"<if condition="$products_type eq 2 ">selected="selected"</if> >拍卖</option>
                <option value="3"<if condition="$products_type eq 3 ">selected="selected"</if> >公益</option>
                            
              </select>
              <input type="text" value="{$keyword}" style="width:150px;" class="text-input " id="keyword" name="keyword" placeholder="名称、描述">
              <strong><a onClick="document.sreach.submit(); return false;" href="#">Search</a></strong>
            </form>
            </div>
            
			<div class="clear"></div> <!-- End .clear -->
            {$msg}
               <div class="content-box"><!-- Start Content Box -->                  
                  <div class="content-box-header">  
                      <span class="insert" style=" float:right; line-height:40px; font-size:14px; font-weight:bold;"> 
                      
                      <a href="{:U('detail')}">+ insert </a>&nbsp; &nbsp; </span>
                    <div class="clear"></div>                      
                  </div> <!-- End .content-box-header -->
                  
                  <div class="content-box-content">
                      <div class="tab-content default-tab" id="tab1">                       
                      <!-- This is the target div. id must match the href of this div's tab -->	
                      
                          
                          <table id="list">
                            <thead>
                              <tr >		   
                                  <th>ID{:createUpDownLink('products_id')}</th>
                                  <th>名称{:createUpDownLink('products_name')}</th>   
                                 <!-- <th  >Category</th>  -->                             
                                  <th  >发布状态</th>
                                  <th  >关闭状态</th>
                                  <th  >推荐</th>
                                  <th  >卖出</th>
                                  <th   >发布日期{:createUpDownLink('products_date_added')}</th> 
                                  <th>排序{:createUpDownLink('sort_order')}</th>     	                                                                                                        
                                  <th  width="200" style="text-align:center"></th>									   						 
                              </tr>								
                            </thead> 
                            
                   
                
                            <tbody>                              
                            <volist name="infoList" id="vo" mod="2" >


                            	<tr align="center" <eq name="mod" value="1">class="alt-row"</eq>>
                                	<td align="left" class="first-cell" >
                                      {$vo.products_id}
                                      </td>
                                      <td align="left">
                                      {$vo.products_name}
                                      </td>
                                      <!--<td align="left">
                                      {$vo.products_id|get_products_to_category}
                                      </td>-->
                                      <td align="center" class="status" id="{$vo.products_id}">
                                      <if condition="$vo.products_status eq 1">
                                        <span  class="hidden current"><img src="__PUBLIC__/images/icons/status_green.gif" />&nbsp;&nbsp;<img src="__PUBLIC__/images/icons/status_red_light.gif"  class="light"/></span>
                                        <span  class="hidden"><img src="__PUBLIC__/images/icons/status_green_light.gif" class="light" />&nbsp;&nbsp;<img src="__PUBLIC__/images/icons/status_red.gif" /></span>
                                    <else />
                                        <span  class="hidden" ><img src="__PUBLIC__/images/icons/status_green.gif" />&nbsp;&nbsp;<img src="__PUBLIC__/images/icons/status_red_light.gif" class="light" /></span>
                                        <span  class="hidden current"><img src="__PUBLIC__/images/icons/status_green_light.gif" class="light" />&nbsp;&nbsp;<img src="__PUBLIC__/images/icons/status_red.gif" /></span>
                                     </if>
                                      </td>
                                      <td align="center">
                                      		<if condition="$vo.products_close eq 1">已关闭  </if>
                                      </td>
                                      <td align="center">
                                      		<if condition="$vo.recommend eq 1">已推荐<else />未推荐  </if>
                                      </td>
                                       <td align="center" class="status" id="{$vo.products_id}">
                                   			 <if condition="$vo.show_flag eq 1">已卖出<else />正在卖  </if>
                                      </td>
                                       <td align="center" >{$vo.products_date_added}</td>	
                                      <td align="center" >{$vo.sort_order}</td>	
                                      <td align="center" >   
                                       <a href="{:U('detail',array('id'=>$vo['products_id']))}" title="Edit">Edit</a> &nbsp; &nbsp;                              
                                      <a href="{:U('deleteProduct',array('id'=>$vo['products_id']))}"  onClick="return confirm('Delete this products?')"  title="Delete">Delete</a> 
                                      </td>
                                    </tr> 
                                            
                              </volist>
                            </tbody>
                          </table>
                          <div class="pagination">{$page}<div style=" clear:both;"></div></div>						
                      </div> <!-- End #tab1 -->	
                                       
                      
                  </div> <!-- End .content-box-content -->
                  
              </div> <!-- End .content-box -->
             
			
			
			<div class="clear"></div>
			
			
			<!-- Start Notifications -->
			
			

			
			<!-- End Notifications -->
			
            <div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
						&#169; Copyright 2013
				</small>
			</div>
			
			
			
			<!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div>
	</body>
<!-- Download From www.exet.tk-->
</html>